package com.qf.erp_system_admin.service.impl;

import com.qf.erp_system_admin.entity.*;
import com.qf.erp_system_admin.mapper.OrderMapper;
import com.qf.erp_system_admin.service.OrderService;
import com.qf.erp_system_admin.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * --- 一点都不难 ---
 *
 * @author DZW
 * @date 2024/7/22
 * @desc
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<Order> findAll(HashMap<String,String> map) {
        return orderMapper.findAll(map);
    }

    @Override
    public List<Order> findShip(HashMap<String, String> map) {

        return orderMapper.findShip(map);
    }

    @Override
    public List<Order> findPut(HashMap<String, String> map) {
        return orderMapper.findPut(map);
    }

    @Override
    public List<Order> noPay(HashMap<String, String> map) {
        return orderMapper.noPay(map);
    }

    @Override
    public List<Order> overDeal(HashMap<String, String> map) {
        return orderMapper.overDeal(map);
    }

    @Override
    public boolean updateShipSta(int id) {
        return orderMapper.updateShipSta(id);
    }

    @Override
    public HashMap<String,Client> moreMessage(int id) {
        return orderMapper.moreMessage(id);
    }

    @Override
    public List<GoodsVo> moreGoods(int id) {
        return orderMapper.moreGoods(id);
    }

    @Override
    public List<Goods> findGoods() {
        return orderMapper.findGoods();
    }

    @Override
    public void saveBatch(List<Order> list){
        orderMapper.saveBatch(list);
    }

    @Override
    public List<Client> findAllClient() {
        return orderMapper.findAllClient();
    }

    @Override
    public boolean addClient(List<Object> list) {
        return orderMapper.addClient(list);
    }

    @Override
    public boolean adOrder(Order order) {
        order.setOrderNum("1u23hi"+Math.random()*100+"1hj34");
        order.setOrderShipSta(0);
        order.setOrderAfterSta(1);
        order.setOrderShipSta(0);
        order.setOrderTime(new Date());
        return orderMapper.addOrder(order);
    }
}
